package com.movecar.ui;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.movecar.R;
import com.movecar.utils.Alert;
import com.movecar.utils.ConfigCacheUtil;
import com.nostra13.universalimageloader.core.ImageLoader;

/**
 * 更多
 * 
 * @author Zhao.JQ
 * 
 */
@SuppressLint("NewApi")
public class MoreInstallActivity extends Activity implements OnClickListener {

	private ImageLoader imageLoader = null;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.more_install);
		imageLoader = ImageLoader.getInstance();
		initView();
	}

	@SuppressLint("SetJavaScriptEnabled")
	private void initView() {
		TextView title = (TextView) findViewById(R.id.title);
		title.setText("设置");
		Button back = (Button) findViewById(R.id.btn_left);
		back.setVisibility(View.VISIBLE);
		back.setOnClickListener(this);

		findViewById(R.id.message_cuing).setOnClickListener(this);
		findViewById(R.id.clean_cache).setOnClickListener(this);
		findViewById(R.id.about_us).setOnClickListener(this);

	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {

		case R.id.btn_left:
			finish();
			break;
		// 个性定制
		case R.id.message_cuing:
			startActivity(new Intent(getApplicationContext(), PersonalizedCustomActivity.class));
			break;

		// 清空缓存
		case R.id.clean_cache:
			ConfigCacheUtil.clearCache(null);
			imageLoader.clearMemoryCache();
			imageLoader.clearDiscCache();
			Alert.warn(this, "缓存清理完毕");
			break;
		// 关于我们
		case R.id.about_us:
			startActivity(new Intent(getApplicationContext(), AboutUsActivity.class));
			break;
		default:
			break;
		}

	}

}
